<?php
require_once('lanceur_spip.php');
include_spip('functions/pdk_common');
require_once(_DIR_PLUGIN_PDK.'classes/simpletest/class.PdkTest.php');

class TestClassProductExcel extends PdkTest {
    /**
     * ProductExcel
     */
    private $p_ex;
    
    public function __construct(){
        parent::__construct();
        $this->p_ex = pdk_load_class('ProductExcel', 'classes');
    }
    
    /**
     *  Run before each test
     */
    function setUp() {
       // parent::setUp();    
    }
    
    /**
     *  Run after each test
     */
    function tearDown() {
       // parent::tearDown();
    }
    
    function __destruct() {
        // Call parent destructor to delete created tables
       // parent::__destruct();
    }
    
    function TestBackupExcel() {
        $filename = 'products_test.xls';
        $this->p_ex->BackupExcel($filename);
        $full_path = $this->p_ex->GetTmpDir().$filename;
        $this->assertTrue(file_exists($full_path),'Excel file hasn\'t been created!');
        if (file_exists($full_path))
            unlink($full_path);
    }
}
